package fr.upmc.alasca.centreCalcul.interne.machinePhysique.ports;

import java.util.List;

import fr.upmc.alasca.centreCalcul.interne.machinePhysique.MachinePhysique;
import fr.upmc.alasca.centreCalcul.interne.machinePhysique.interfaces.MachinePhysiqueAdmissionI;
import fr.upmc.components.ComponentI;
import fr.upmc.components.ports.AbstractInboundPort;


/**
 * @author Antoine Lavaire, Sabri Labassi, Thibaut Fleury, Ryme Fantazi
 */
public	class	MachinePhysiqueAdmissionInboundPort
extends			AbstractInboundPort
implements		MachinePhysiqueAdmissionI
{
	private static final long serialVersionUID = 1L;

	
	
	public		MachinePhysiqueAdmissionInboundPort
	(
			String 		uri,
			ComponentI 	owner
	) throws	Exception
	{
		super(uri, MachinePhysiqueAdmissionI.class, owner);
		
		assert uri != null && owner instanceof MachinePhysique;
	}

	
	/**
	 * @see fr.upmc.alasca.centreCalcul.interne.machinePhysique.interfaces.MachinePhysiqueAdmissionI#reserverCoeur(java.lang.String, int)
	 */
	@Override
	public	int		reserverCoeur
	(
			String	uriApplication,
			int		nbCoeursAReserver
	) throws	Exception
	{
		final MachinePhysique mp = (MachinePhysique)this.owner;
		
		return mp.reserverCoeur(uriApplication, nbCoeursAReserver);
	}
	
	
	/**
	 * @see fr.upmc.alasca.centreCalcul.interne.machinePhysique.interfaces.MachinePhysiqueAdmissionI#relacherCoeur(java.lang.String, int)
	 */
	@Override
	public	void	relacherCoeur
	(
			String	uriApplication,
			List<String> uriCoeurs
	) throws	Exception
	{
		final MachinePhysique mp = (MachinePhysique)this.owner;
		
		mp.relacherCoeur(uriApplication, uriCoeurs);
	}

}
